package com.imooc.miaosha.vo;

import com.google.common.collect.Lists;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Map<String, Integer> qMap = new HashMap<>();
        qMap.put("小米", 40);
        qMap.put("黑米", 20);
        qMap.put("白米", 30);
        HashMapComparator hashMapComparator = new HashMapComparator();
        List<Map.Entry<String, Integer>> mapList = Lists.newArrayList();
        mapList.addAll(qMap.entrySet());
        Collections.sort(mapList, hashMapComparator);
        for (Iterator<Map.Entry<String,Integer>> it = mapList.iterator(); it.hasNext();) {
            System.out.println(it.next());
        }
    }
}
